package cn.wit.Test;
import java.util.Scanner;
/**
 * 计算月的天数
 * @author 16604
 *
 */

public class TestMonthDay {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int year = in.nextInt();
		int month = in.nextInt();
		
		//判断是不是闰年
		if(year%4 == 0&&year%100 != 0||year%400 == 0) {
			System.out.println("闰年");
			switch(month) {
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
				System.out.println(31);
				break;
			case 4:
			case 6:
			case 9:
			case 11:
				System.out.println(30);
				break;
			case 2:
				System.out.println(29);
				break;
			default:
				System.out.println("输入错误");
				break;
			}
				
		}else {
			System.out.println("平年");
			switch(month) {
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
				System.out.println(31);
				break;
			case 4:
			case 6:
			case 9:
			case 11:
				System.out.println(30);
				break;
			case 2:
				System.out.println(28);
				break;
			default:
				System.out.println("输入错误");
				break;
			}
		}
	}

}
